<?php
class infotypeApp extends core
{
	public function indexAction($arg)
	{
		$template	= $this->template();
		$infotype	= base::init('infotype')->fetchAll();
		
		$template->assign('infotype', $infotype);
		$template->display('infotype_index.php');
	}
	
	public function addAction($arg)
	{
		base::init('infotype')->insert($arg);
		$this->refresh('add done', 'index.php?m=infotype');
	}
	
	public function editAction($arg)
	{
		base::init('infotype')->update(array('name'=>$arg['name']),array('id'=>$arg['id']));
		$this->refresh('edit done', 'index.php?m=infotype');
	}
	
	public function deleteAction($arg)
	{
		base::init('infotype')->delete(array('id'=>$arg['id']));
		$this->refresh('delete done', 'index.php?m=infotype');
	}
}